digits=[1,2,3,4] #定义一共数组
results=[]
for i in digits:
    for j in digits:
        for k in digits:
            if i!=j and i!=k and j!=k:
                num = i*100+j*10+k
                results.append(num)#将获得的数加入到空数组里面
print(f"能组成的三位数个数为{len(results)}")
print("这些数分别为:")
for num in results:
    print(num)